<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateElOrderItemUnitTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('el_order_item_unit', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('order_item_id')->unsigned();
            
            $table->integer('adjustments_total');  //优惠金额
            $table->integer('total');  //该商品实际支付金额  unitPrice + adjustmentsTotal

            $table->string('shipping_state');   //发货状态
            $table->integer('shipment_id')->unsigned()->default(0);  //物流表ID
    
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('el_order_item_unit');
    }
}
